var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.npc_ChangeController(3004302, "oid=366796", 143, 275, 9, 93, 193, 1, false, 0, false);
            cm.npc_ChangeController(3004303, "oid=366797", 197, 275, 10, 147, 247, 1, false, 0, false);
            cm.npc_ChangeController(3004300, "oid=366798", -525, 275, 3, -575, -475, 1, false, 0, false);
            cm.npc_ChangeController(3004335, "oid=2752523", 53, 274, 15, 3, 103, 1, false, 0, false);
            cm.npc_SetSpecialAction("oid=2752523", "summon", 0, 0);
            cm.npc_ChangeController(3004304, "oid=2752524", -132, 228, 7, -182, -82, 0, false, 0, false);
            cm.npc_SetSpecialAction("oid=2752524", "summon", 0, 0);
            cm.npc_SetSpecialAction("oid=2752523", "special2", cm.getQuestStatus(37306) > 0 ? 1 : -1, 1);
            cm.npc_ChangeController(3004329, "oid=2752525", -35, 228, 8, -85, 15, 1, false, 0, false);
            cm.npc_SetSpecialAction("oid=2752525", "summon", 0, 0);
            cm.dispose()
        }
    }
};